<template>
  <el-table-column :label="coloumnHeader.label" :prop="coloumnHeader.prop" align="center" :fixed="coloumnHeader.fixed||false">
    <template v-for="(col, index) in coloumnHeader.children">
      <tableColumn
        v-if="col.children && col.children.length"
        :key="`header_${col.prop}${index}`"
        :coloumn-header="col"
      ></tableColumn>
       <el-table-column

        :fixed="col.fixed || false"
        :label="col.label"
        :key="`col_${index}`"
        :prop="col.prop"
        :width="col.width || null"
        :hidden="col.hidden"
        :align="col.align"
        :sortable="col.sortable||false"
      >
        <template slot-scope="{row}">
          <span v-if="col.isComponent === true && col.comps">
            <component
              v-for="comp in col.comps"
              :key="comp.compKey"
              :is="comp.component"
              :codeField="comp.codeField"
              :textField="comp.textField"
              :popupsKey="comp.compKey"
              :isShow="row[comp.compareField]===comp.compareValue"
              :code="row[comp.codeField]"
              :text="row[comp.textField]"
              @changeCode="getRowComponentCode"
              @clickEvent="comp.clickEvent"
              :comType="row.index+''"
              :isMul="comp.isMul"
              :span="col.span || 24"
              :isShowLabel="comp.isShowLabel"
              :labelName="comp.labelNameArray?(row[comp.labelNameArray[0]]==comp.labelNameArray[1][0].split(',')[0]?comp.labelNameArray[1][0].split(',')[1]:comp.labelNameArray[1][1].split(',')[1]):comp.labelName"
              :lookuptype="comp.lookuptype"
              :format="comp.format"
              :dateType="comp.dateType"
              :dateOptionsType="comp.dateOptionsType"
              :contWay="[row,comp.contWay]"
              :clearable="comp.clearable"
              :filterable="comp.filterable"
              :curTableRow="comp.rowFileds?row:null"
              :rowFileds="comp.rowFileds"
              :disabled="row[comp.disabled]"
            ></component>
          </span>
          
          <span
            v-else
          >{{ row[col.prop] }}</span>
          
        </template>
      </el-table-column>
        
      
    </template>
  </el-table-column>
</template>

<script>
export default {
  name: "tableColumn",
  props: {
    coloumnHeader: {
      type: Object,
      required: true
    }
  },
  data() {
    return {
      
    };
  },
  methods: {
    
  }
};
</script>